package model

import "time"

type Goods struct {
	Id          uint      `gorm:"column:id;type:bigint(20) UNSIGNED;primaryKey;not null;" json:"id"`
	CreatedAt   time.Time `gorm:"column:created_at;type:datetime(3);not null;" json:"created_at"`
	UpdatedAt   time.Time `gorm:"column:updated_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"updated_at"`
	DeletedAt   time.Time `gorm:"column:deleted_at;type:datetime(3);default:NULL;" json:"deleted_at"`
	UserId      uint      `gorm:"column:user_id;type:bigint(20) UNSIGNED;not null;default:0;" json:"user_id"`
	ProductName string    `gorm:"column:product_name;type:varchar(255);not null;" json:"product_name"`
	Price       float64   `gorm:"column:price;type:decimal(10, 2) UNSIGNED;not null;default:0.00;" json:"price"`
	Cover       string    `gorm:"column:cover;type:varchar(255);not null;" json:"cover"`
	Describe    string    `gorm:"column:describe;type:varchar(255);not null;" json:"describe"`
}

func (g *Goods) TableName() string {
	return "goods"
}
